-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add methods to configure context lines for fingerprinting #1943
base: 13.0.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI elements are missing:
- https://github.com/jenkinsci/warnings-ng-plugin/blob/main/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ReportScanningTool/config.jelly
- a help HTML file in the same folder
(There is also a test missing but this is optional here as this requires more work than the actual feature.)
@@ -365,7 +372,13 @@ private void createFingerprints(final Report report) { | |||
report.logInfo("Creating fingerprints for all affected code blocks to track issues over different builds"); | |||
|
|||
FingerprintGenerator generator = new FingerprintGenerator(); | |||
generator.run(new FullTextFingerprint(), report, getCharset()); | |||
if (linesLookAhead < 0) { | |||
//Empty constructor defaults context lines to 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//Empty constructor defaults context lines to 3 | |
// no-arg constructor defaults context lines to 3 |
The broken tests are not you fault: somehow the Java 17 Jenkins release does not work with my docker tests right now. I am still trying to understand what is going on here... |
I'd be happy to help if you could guide me on the steps to get started with the tests. |
...in/src/main/resources/io/jenkins/plugins/analysis/core/model/ReportScanningTool/config.jelly
Outdated
Show resolved
Hide resolved
...n/resources/io/jenkins/plugins/analysis/core/model/ReportScanningTool/help-contextLines.html
Outdated
Show resolved
Hide resolved
For a test a good staring point are the test cases in Currently theses test have one build to show a warning in a file. What we need is: two builds where the warning is moved in the file by e.g. one line in the second build (so we need the same source code file slightly modified by inserting a new line somewhere before). This warning should be marked as existing warning based on a small value of the fingerprint. But when the changed line is included in the fingerprint then the warning should still be marked as existing. |
When the changed line is included in the fingerprinting of the second build , wont the fingerprint change and result in a |
This is exactly the point. The fingerprint is changed with the default setting, but not with the changed setting. So the build should have a different result depending on the new property: then we prove that the new setting works. |
BTW: I disabled the broken tests in the 13.x branch, maybe it makes sense to rebase so that your build is green as well... |
oh ok i think i get it now , i will push changes in a bit . Thank you. |
d3b9045
to
d40a85a
Compare
This PR introduces a tool-based configuration for setting the context lines considered during the fingerprinting process in FullTextFingerprint.
See :
https://issues.jenkins.io/browse/JENKINS-61607
jenkinsci/analysis-model#1136
jenkinsci/analysis-model-api-plugin#184
Submitter checklist